local table_name = "luckyturntable"
local old_table = IMPORT_D:get_table(table_name)
if not old_table then
    return
end

local BigNum = require "BigNum"

local new_table = {}
local award_fields = { "largeCoin", "largeSoul", "largeYuanbao", "largeEnlarge", "fewCoin", "fewSoul", "fewYuanbao", "fewEnlarge", }
for i, v in pairs(old_table) do
    local awards = {}
    for _, idx in ipairs(string.split(v.typeOrder, ";")) do
        local index = tonumber(idx)
        local field = award_fields[index]
        if not field then
            break
        end

        local award = v[field]
        if award then
            awards[index] = BigNum.new(award)
        end
    end

    local weight = {}
    for idx, val in ipairs(string.split(v.typeWeight, ";")) do
        weight[idx] = tonumber(val)
    end

    local t = {}
    t.awards = awards
    t.weight = weight
    new_table[i] = t
end

IMPORT_D:set(table_name, new_table)
